<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/templates/turnitup_template.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="top">
        <ui:include src="./WEB-INF/templates/logo_bar.xhtml"/>
        <ui:include src="./WEB-INF/templates/search_bar.xhtml"/>
        <p:breadCrumb>
            <p:menuitem outcome="index"/>
            <p:menuitem value="#{webtext.advanced_search}" url="#"/>
        </p:breadCrumb>
    </ui:define>

    <ui:define name="menu_left">
        <ui:include src="./WEB-INF/templates/category_menu.xhtml"/>
    </ui:define>

    <ui:define name="basket">
        <ui:include src="./WEB-INF/templates/basket_widget.xhtml"/>
    </ui:define>

    <ui:define name="content">
        <h:panelGroup layout="block" id="content_panel">
            <h:outputText id="login_title" value="#{webtext.advanced_search}"/>
            <h:form>
                   <h:panelGrid columns="3">
                    <h:outputLabel styleClass="adv_search" value="#{webtext.search_term}" for="search_term" />
                    <p:inputText id="search_term" value="#{productController.searchCriteria.searchTerm}"/>
                    <h:outputText value=" "/>
                    
                    <h:outputLabel styleClass="adv_search" value="#{webtext.search_price}" for="price_min" />
                    <p:inputText id="price_min" type="number" size="5" value="#{productController.searchCriteria.searchMinPrice}"/>
                    <p:inputText id="price_max" type="number" size="5" value="#{productController.searchCriteria.searchMaxPrice}"/>
                    
                    <h:outputLabel styleClass="adv_search" value="#{webtext.search_cat}" for="search_cat" />
                    <h:selectOneMenu id="search_cat" value="#{productController.searchCriteria.searchCategory}">
                        <f:selectItems value="#{categoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputText value=" "/>
                    
                    <h:outputLabel styleClass="adv_search" value="#{webtext.search_stock}" for="search_stock" />
                    <p:selectBooleanCheckbox id="search_stock" value="#{productController.searchCriteria.searchStock}"/>
                    <h:outputText value=" "/>
                    </h:panelGrid>
                
                    <p:commandButton value="#{webtext.search_bar}" action="#{productController.prepareSearch}"/>
                   
            </h:form>
        </h:panelGroup>
    </ui:define>

    <ui:define name="footer">
        <ui:include src="./WEB-INF/templates/footer.xhtml"/>
    </ui:define>

</ui:composition>
